<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>夺金网--配送服务</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
     <table width="700">
     	<tr>
     	  <td align="center" width="20%">商品名称</td>
     	  <td align="center" width="10%">商品购买者</td>
     	  <td align="center" width="25%">发货地址</td>
     	  <td align="center" width="20%">付款时间</td>
     	  <td align="center" width="20%">收件人联系方式</td>
     	  <td align="center" width="5%"></td>
     	</tr>
     	</table>	
     	<c:forEach var="delivery" items="${deliveriedList }">
     	<% int state=Integer.parseInt(request.getAttribute("state").toString());   	  
     	  	if(state==0){
     	  	   	  	 %>
     	<form method="POST" action="${contextPath }/delivery.do?operation=modifyDelivery&deliveryId=${delivery.deliveryId}">
     	<table width="700">
     	  <tr>
     	  	<td align="center" width="20%">${delivery.product.productName }</td>
     	  	<td align="center" width="10%">${delivery.user.userName }</td>
     	  	<td align="center" width="25%">${delivery.address }</td>
     	  	<td align="center" width="20%">${delivery.product.endAuction.payTime }</td>
     	  	<td align="center" width="20%">${delivery.phone }</td>
     	  	<td align="center" width="5%">  	  
     	  	<input type="submit" value="发送"/>
     	 
     	  	</td>
     	  </table>	
     	  </form>
     	  <%}else if(state==1){%>
     	  <form method="POST" action="${contextPath }/delivery.do?operation=deleteDelivery&deliveryId=${delivery.deliveryId}">
     	  <table width="700">
     	  <tr>
     	  	<td align="center" width="20%">${delivery.product.productName }</td>
     	  	<td align="center" width="10%">${delivery.user.userName }</td>
     	  	<td align="center" width="25%">${delivery.address }</td>
     	  	<td align="center" width="20%">${delivery.product.endAuction.payTime }</td>
     	  	<td align="center" width="20%">${delivery.phone }</td>
     	  	<td align="center" width="5%">  	  
     	  	<input type="submit" value="删除"/>
     	 
     	  	</td>
     	  </table>	
     	  </form><%}%>
     </c:forEach>
     </table>	     	
  </body>
</html>
